// 引入koa-router
const Router = require('koa-router')
// 引入上传头像utils
const {uploadimg} = require('../../utils/uploadUtils')
// 引入处理函数
const {uploadImg, delUploadImg} = require('../../controller/uploadImg.controller')
// 创建实例
// prefix在路由地址前缀加上默认地址
const router = new Router({ prefix:'/api/upload' })
// 通用单个图片上传
router.post('/uploadimg',uploadimg.single('file'),uploadImg)
// 通用单个图片删除
router.post('/deluploadimg',delUploadImg)
module.exports = router